﻿using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class CharacterSelect : MonoBehaviour
{
    public string desc;

    public TextMeshProUGUI descText;

    public BaseDeckScriptable defaultDeck;
    public PlayerEntityData playerEntityData;
    
    public int confirmCount = -1;

    public void OnClick()
    {
        confirmCount += 1;

        if (confirmCount == 1)
        {
            // 设置好角色相关参数
            playerEntityData.currentDeck = new List<CardPair>(defaultDeck.cards);

            // 通知场景切换是时候换场景了
            SceneLoader sl = GameObject.FindGameObjectWithTag(StaticDataManager.SCENE_LOADER_TAG)
                .GetComponent<SceneLoader>();

            sl.LoadRouteScene();
        }

        SetText();
    }

    private void SetText()
    {
        descText.SetText(desc);
    }
}
